#ifndef _ROS_robik_GenericControl_h
#define _ROS_robik_GenericControl_h

#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
#include "std_msgs/Header.h"

namespace robik
{

  class GenericControl : public ros::Msg
  {
    public:
      std_msgs::Header header;
      uint32_t gen_operation;
      int32_t gen_param1;
      int32_t gen_param2;

    virtual int serialize(unsigned char *outbuffer) const
    {
      int offset = 0;
      offset += this->header.serialize(outbuffer + offset);
      *(outbuffer + offset + 0) = (this->gen_operation >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (this->gen_operation >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (this->gen_operation >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (this->gen_operation >> (8 * 3)) & 0xFF;
      offset += sizeof(this->gen_operation);
      union {
        int32_t real;
        uint32_t base;
      } u_gen_param1;
      u_gen_param1.real = this->gen_param1;
      *(outbuffer + offset + 0) = (u_gen_param1.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_gen_param1.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_gen_param1.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_gen_param1.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->gen_param1);
      union {
        int32_t real;
        uint32_t base;
      } u_gen_param2;
      u_gen_param2.real = this->gen_param2;
      *(outbuffer + offset + 0) = (u_gen_param2.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_gen_param2.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_gen_param2.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_gen_param2.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->gen_param2);
      return offset;
    }

    virtual int deserialize(unsigned char *inbuffer)
    {
      int offset = 0;
      offset += this->header.deserialize(inbuffer + offset);
      this->gen_operation =  ((uint32_t) (*(inbuffer + offset)));
      this->gen_operation |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->gen_operation |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      this->gen_operation |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      offset += sizeof(this->gen_operation);
      union {
        int32_t real;
        uint32_t base;
      } u_gen_param1;
      u_gen_param1.base = 0;
      u_gen_param1.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_gen_param1.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_gen_param1.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_gen_param1.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->gen_param1 = u_gen_param1.real;
      offset += sizeof(this->gen_param1);
      union {
        int32_t real;
        uint32_t base;
      } u_gen_param2;
      u_gen_param2.base = 0;
      u_gen_param2.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_gen_param2.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_gen_param2.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_gen_param2.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->gen_param2 = u_gen_param2.real;
      offset += sizeof(this->gen_param2);
     return offset;
    }

    const char * getType(){ return "robik/GenericControl"; };
    const char * getMD5(){ return "5e7b60be9b0bb95832f537f1e7feffad"; };

  };

}
#endif